{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1548776803.12\n",
      "time.struct_time(tm_year=2019, tm_mon=1, tm_mday=29, tm_hour=23, tm_min=46, tm_sec=43, tm_wday=1, tm_yday=29, tm_isdst=0)\n",
      "time.struct_time(tm_year=2019, tm_mon=1, tm_mday=29, tm_hour=23, tm_min=46, tm_sec=43, tm_wday=1, tm_yday=29, tm_isdst=0)\n",
      "Tue Jan 29 23:46:43 2019\n",
      "2019\n",
      "2019 01 29\n",
      "2019 01 29 23:46:43\n",
      "1548776803.0\n"
     ]
    }
   ],
   "source": [
    "import time \n",
    "\n",
    "\n",
    "print time.time()\n",
    "print time.localtime()\n",
    "print time.localtime(time.time())\n",
    "print time.asctime(time.localtime(time.time()))\n",
    "\n",
    "print time.strftime('%Y',time.localtime())\n",
    "print time.strftime('%Y %m %d',time.localtime())\n",
    "print time.strftime('%Y %m %d %H:%M:%S',time.localtime())\n",
    "print time.mktime(time.localtime())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "    January 2016\n",
      "Mo Tu We Th Fr Sa Su\n",
      "             1  2  3\n",
      " 4  5  6  7  8  9 10\n",
      "11 12 13 14 15 16 17\n",
      "18 19 20 21 22 23 24\n",
      "25 26 27 28 29 30 31\n",
      "\n"
     ]
    }
   ],
   "source": [
    "import calendar\n",
    "\n",
    "cal = calendar.month(2016,1)\n",
    "print cal"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('\\xd6\\xd0\\xb9\\xfa\\xb1\\xea\\xd7\\xbc\\xca\\xb1\\xbc\\xe4', '\\xd6\\xd0\\xb9\\xfa\\xcf\\xc4\\xc1\\xee\\xca\\xb1')\n"
     ]
    }
   ],
   "source": [
    "print time.tzname"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "False\n"
     ]
    }
   ],
   "source": [
    "print calendar.isleap(2019)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1548777043.36\n"
     ]
    }
   ],
   "source": [
    "def printtimestamp():\n",
    "    print time.time()\n",
    "    \n",
    "printtimestamp()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<type 'list'>\n",
      "True\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "59"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def addup(list):\n",
    "    a = 0\n",
    "    print type(list)\n",
    "    print type(list) == type([])\n",
    "    if type(list) == type([]):\n",
    "        for i in list:\n",
    "            a += i\n",
    "    return a\n",
    "\n",
    "\n",
    "\n",
    "addup([1,2,56])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.15"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
